#########################################################################################
# Replication Files for #################################################################
# "Natural Disasters, 'Partisan Retrospection,' and U.S. Presidential Elections #########
# by Boris Heersink, Jeffery A. Jenkins, Michael P. Olson, and Brenton D. Peterson ######
# Forthcoming in Political Behavior #####################################################
#########################################################################################

# Overview
 
	This file describes all of the datasets and scripts necessary to replicate the
	results presented in "Natural Disasters, 'Partisan Retrospection,' and U.S.
	Presidential Elections" by Heersink, Jenkins, Olson, and Peterson. 

# Instructions

	Results in the paper can be replicated by first acquiring data on Hurricane Sandy
	damage from SHELDUS 18.1. Because this data is proprietary we cannot share it. We 
	acquired data using a date-location call for all U.S. counties from October 26th
	to November 2nd, 2012. With this data in hand, start with "run_all_files.R" which
	allows the replicator to set a working directory and loads necessary packages.
	Results will be saved to a sub-directory called "results" so the repicator should
	make this if necessary. "gasper_reeves_analysis.R" generates secondary datasets that
	are then used in "fitted_treatment_plot.do" which must be run in Stata before then 
	continuing to run "gasper_reeves_predictedvalues.R" which plots the results of the 
	Stata output. 

# Software

	Nearly all analysis was undertaken in R version 4.0.2. Analysis for one plot was
	done in Stata 16.1. Additional required R packages include lfe, haven, stringr,
	DataCombine, dplyr, stargazer, ggplot2, interflex, readxl, and tidyr.

# Scripts

	sandy_analysis.R
		This script produces all results in the text and robustness checks for the 
		Hurricane Sandy analysis. *Note* replicator must acquire relevant data on
		Sandy damage from SHELDUS, as noted above, before using this script. This 
		script produces Table 1 and Figure 2 in the text and Table A.1, Figure B.1, 
		Table B.1, Figure B.2, Table B.2, Table B.3, Table B.4, Table B.4, Table B.5, 
		and Table B.6 in the Supplementary Appendix.

	gasper_reeves_analysis.R
		This script contains analyses for the replication of Gasper and Reeves (2011).
		It includes produces Table 2 and Figure 3 in the text, and Table A.2, Table C.1, 
		Table C.2, Figure C.1, Table C.3, Figure C.2, Table C.4, Table C.5, and Table 
		C.6 in the Supplementary Materials. It also produces gr_corrected_stata.dta,
		newdata_contra.dta, and newdata_copart.dta which are subsequently used in
		fitted_treatment_plot.do.

	fitted_treatment_plot.do
		This Stata do file runs a model analogous to that is gasper_reeves_analysis.R
		and generates predicted values using newdata_contra.dta and newdata_copart.dta,
		then saves these predicted values in newdata_contra_fits.dta and 
		newdata_copart_fits.dta for use making a plot in gasper_reeves_predictedvalues.R.

	gasper_reeves_predictedvalues.R
		This script plots the results from fitted_treatment_plot.do to make Figure 4 in
		the text.


# Data

	sandy_dat_nosheldus.csv
		This data file contains all variables *except Hurricane Sandy damage, which the 
		replicator must themselves acquire as noted above.* 

	gr_corrected.csv
		This data file contains all variables necessary for our extended panel analysis.
	
	gr_uncorrected.csv
		This data file is used to create one table that does not remove duplicate 
		observations from gasper and reeves (2011) original analysis.
		